#include<bits/stdc++.h>
using namespace std;
const int N = 1e5+5;
unordered_map<int,int> life;
unordered_map<int,int> attack;
int n,a[N],tot;
int main(){
    freopen("duel.in","r",stdin);
    freopen("duel.out","w",stdout);
    cin>>n;
    for(int i=1;i<=n;++i){
        int x;
        cin>>x;
        if(life[x]==0) a[++tot]=x;
        life[x]++; attack[x]++;
    }
    int ans=n;
    sort(a+1,a+tot+1);
    for(int i=1,j=i+1;i<=tot-1&&j<=tot;){
        while(life[a[i]]&&attack[a[j]]){
            life[a[i]]--;
            ans--;
            attack[a[j]]--;
        }
        if(life[a[i]]==0) i++;
        if(attack[a[j]]==0||i>=j) j++;
    }
    cout<<ans;
    return 0;
}